﻿<UserControl x:Class="Mal.Balades.Admin.Views.VisitViews.Edit.PicturesTab"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:controls="clr-namespace:Mal.Balades.Admin.Controls"
    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:dataToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Toolkit"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot"  >
        <CheckBox IsChecked="{Binding SourceVisit.QualityPictures,Mode=TwoWay}" />
        <controlsToolkit:ListBoxDragDropTarget  AllowDrop="True" HorizontalAlignment="Left" Margin="0,50,0,0">
            <ListBox ItemsSource="{Binding SourceVisit.Pictures}" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Width="800">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition />
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <Image Grid.Column="0"  
                                Width="100" Margin="10"
                                Source="{Binding FileUrl}" />

                            <ComboBox  Grid.Column="1"
                                    ItemsSource="{Binding PictureTypes}"
                                    SelectedItem="{Binding SelectedPictureType, Mode=TwoWay}">
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Name}" />
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>

                            </ComboBox>

                            <TextBox Text="{Binding Url,Mode=TwoWay}"  Grid.Column="2" />
                            
                            <controls:HtmlTextEditor Grid.Column="3"
                                Height="100" Style="{StaticResource HtmlText}"
                                Text="{Binding Title, Mode=TwoWay}" />
                        </Grid>         
                        
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical"></StackPanel>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>

        </controlsToolkit:ListBoxDragDropTarget>
        
            <!--<dataToolkit:DataGridDragDropTarget  AllowedSourceEffects="All"
                                                 ItemDragCompleted="DataGridDragDropTarget_ItemDragCompleted"
                                                 
                AllowDrop="True" >

                <data:DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch"
                               SelectionMode="Extended"
                        ItemsSource="{Binding SourceVisit.Pictures}">
                    <data:DataGrid.Columns>
                        <data:DataGridTemplateColumn >
                            <data:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Image Source="{Binding FileUrl}" Width="100" Margin="10" />
                                    </Grid>
                                </DataTemplate>
                            </data:DataGridTemplateColumn.CellTemplate>
                        </data:DataGridTemplateColumn>

                        <data:DataGridTemplateColumn Header="Text">
                            <data:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <controls:HtmlTextEditor Height="100"
                                             Style="{StaticResource HtmlText}"
                                             Text="{Binding Title, Mode=TwoWay}" />
                                    </Grid>
                                </DataTemplate>
                            </data:DataGridTemplateColumn.CellTemplate>
                        </data:DataGridTemplateColumn>

                    </data:DataGrid.Columns>
                </data:DataGrid>
            </dataToolkit:DataGridDragDropTarget>-->

            
      
    </Grid>
</UserControl>
